<template>
	<view>
		<uni-section title="基本信息" type="line"></uni-section>
		<uni-list v-if="info.fkjl">
			<uni-list-item title="卡号" :rightText="info.fkjl.kh"></uni-list-item>
			<uni-list-item title="车主名称" :rightText="info.fkjl.czmc"></uni-list-item>
			<uni-list-item title="车主电话" :rightText="info.fkjl.czdh"></uni-list-item>
			<uni-list-item title="司机名称" :rightText="info.fkjl.sjmc"></uni-list-item>
			<uni-list-item title="司机电话" :rightText="info.fkjl.sjdh"></uni-list-item>
		</uni-list>
		<uni-section title="进场信息" type="line">{{parm.date}}</uni-section>
		<uni-list>
			<uni-list-item v-for="o in info.jcjls" :key="o.bh" :title="o.jcsj"></uni-list-item>
		</uni-list>
		<view class="footer" v-if="info.jcjls">
			共计：<text class="num">{{info.jcjls.length}}</text>趟
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				parm: {},
				info: {}
			}
		},
		methods: {

		},
		onLoad(options) {
			this.parm = options;
			uni.request({
				url: `https://www.kongke15888.com/api/faka/info/${options.bh}`,
				data: {
					date: options.date
				},
				success: (res) => {
					let d = res.data;
					if (d.resultCode == 0) {
						this.info = d.record
					} else {
						uni.showToast({
							title: '服务器异常！',
							icon: 'none'
						});
					}
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
	.uni-section {
		margin-top: 0;
	}
	.footer {
		text-align: right;
		margin-right: 30rpx;
		margin-top: 30rpx;
		margin-bottom: 30rpx;
		font-size: 32rpx;
		.num {
			color: #F0AD4E;
			padding: 0 10rpx;
		}
	}
</style>
